package com.FTW.SAA.tools;

import org.springframework.ai.tool.annotation.Tool;
import org.springframework.context.i18n.LocaleContextHolder;
import org.springframework.stereotype.Component;
import java.time.LocalDateTime;

@Component
public class DateTimeTool {
    /**
     * 获取当前系统时间
     *
     * @return LocalDateTime
     * returnDirect = false 不直接返回数据，让LLM根据数据生成回复
     */
    @Tool(description = "获取当前时间",returnDirect = false)
    public String getDateTime() {
        return LocalDateTime.now().atZone(LocaleContextHolder.getTimeZone().toZoneId()).toString();
    }
}
